UCF STIG Viewer Logo
Changes are coming to https://stigviewer.com. Take our survey to help us understand your usage and how we can better serve you in the future.
Take Survey

Database objects (including but not limited to tables, indexes, storage, trigger procedures, functions, links to software external to PostgreSQL, etc.) must be owned by database/DBMS principals authorized for ownership.


Overview

Finding ID Version Rule ID IA Controls Severity
V-214074 PGS9-00-003100 SV-214074r508027_rule Medium
Description
Within the database, object ownership implies full privileges to the owned object, including the privilege to assign access to the owned objects to other subjects. Database functions and procedures can be coded using definer's rights. This allows anyone who utilizes the object to perform the actions if they were the owner. If not properly managed, this can lead to privileged actions being taken by unauthorized individuals. Conversely, if critical tables or other objects rely on unauthorized owner accounts, these objects may be lost when an account is removed.
STIG Date
PostgreSQL 9.x Security Technical Implementation Guide 2022-06-13

Details

Check Text ( C-15290r360853_chk )
Review system documentation to identify accounts authorized to own database objects. Review accounts that own objects in the database(s).

If any database objects are found to be owned by users not authorized to own database objects, this is a finding.

To check the ownership of objects in the database, as the database administrator, run the following SQL:

$ sudo su - postgres
$ psql -x -c "\dn *.*"
$ psql -x -c "\dt *.*"
$ psql -x -c "\ds *.*"
$ psql -x -c "\dv *.*"
$ psql -x -c "\df+ *.*"

If any object is not owned by an authorized role for ownership, this is a finding.
Fix Text (F-15288r360854_fix)
Assign ownership of authorized objects to authorized object owner accounts. 

#### Schema Owner 

To create a schema owned by the user bob, run the following SQL: 

$ sudo su - postgres 
$ psql -c "CREATE SCHEMA test AUTHORIZATION bob"

To alter the ownership of an existing object to be owned by the user bob, run the following SQL: 

$ sudo su - postgres 
$ psql -c "ALTER SCHEMA test OWNER TO bob"